/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.genexus.search;

import java.util.HashMap;
import org.apache.lucene.search.Hits;

/**
 *
 * @author Emiliano
 */
public class ResultsMap {

    private static ResultsMap m_instance = new ResultsMap();
    public static ResultsMap getInstance(){return m_instance;}

	static HashMap results = new HashMap(Integer.MAX_VALUE/1000);

    public void addResult(String query, Hits result){
        if (results.size() == Integer.MAX_VALUE/2000){
            results.clear();
        }

        results.put(query, result);
    }

    public Hits getResult(String query){
        return (Hits)results.get(query);
    }

    public void flushResults(){
        results = new HashMap();
    }
}
